package com.xinyue.center;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;

import com.xinyue.center.logicconfig.GameCenterConfig;
import com.xinyue.mqsystem.event.GameMQEventContext;


@SpringBootApplication
@EnableMongoRepositories("com.xinyue.center.dao")
public class WebGameCenterServerMain {
    
    public static void main(String[] args) {
       ApplicationContext applicationContext= SpringApplication.run(WebGameCenterServerMain.class, args);
       GameCenterConfig gameCenterConfig = applicationContext.getBean(GameCenterConfig.class);
       //启动事件系统
       GameMQEventContext.init(gameCenterConfig.getLocalServerId(), applicationContext);
    }
}




//不想在服务启动的时候初始化数据库的连接信息
//@SpringBootApplication(scanBasePackages= {"com.mygame"},exclude= {MongoAutoConfiguration.class,MongoDataAutoConfiguration.class})